-
Notifications
You must be signed in to change notification settings - Fork 20.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/state: construct access list from current state #22289
core/state: construct access list from current state #22289
Conversation
06200a2
to
48a207f
Compare
ceb7be3
to
4fcf1cb
Compare
4fcf1cb
to
f2ae701
Compare
d38205a
to
e46bd5e
Compare
return nil, fmt.Errorf("failed to apply transaction: %v err: %v", args.ToTransaction().Hash(), err) | ||
} | ||
if res.UsedGas == gas { | ||
vmenv.StateDB.UnprepareAccessList(args.From, args.To, vmenv.ActivePrecompiles()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why we need this Unprepare, whicih also is journalled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was a question I had, whether I should unprepare the access list inside or outside of the statedb.
If I unprepare inside of the statedb (the way it currently is) then this should be journalled. But I guess I should unprepare it outside of the statedb.
We need unprepare to remove sender, recipient and the precompiles from the access list
Note to myself, we should only remove the recipient if it has no other state accesses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to myself, we should only remove the recipient if it has no other state accesses
Yes. only if the slotlist is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But really, you only need to 'clean it' as the very last step before returning it to the user.
One gotcha, that I don't think we handle in this PR is that if a tx calls |
Superseeded by #22550 |
Implement access list helpers on top of #21502 and #22290
TODO:
Usage:
Edit: the above output was from before the access list was unprepared.